home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Utilities / Ph 1.1.1 / PhClient / glob.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-17  |  6.5 KB  |  153 lines  |  [TEXT/MPS ]

  1. /*______________________________________________________________________
  2.  
  3.     glob.h - Global Definitions.
  4. _____________________________________________________________________*/
  5.  
  6. #ifndef __glob__
  7. #define __glob__
  8.  
  9. #include "rez.h"
  10. #include "oop.h"
  11.  
  12. /*_____________________________________________________________________
  13.  
  14.     Defines.
  15. _____________________________________________________________________*/
  16.  
  17. #define longSleep            0x7fffffff    /* background idle sleep time in ticks */
  18. #define shortSleep        15                /* foreground idle sleep time in ticks */
  19. #define maxFieldName        18                /* max length of field name */
  20. #define font                "\pMonaco"    /* font */
  21. #define fontSize            9                /* font size */
  22. #define staggerInitial    3                /* initial window staggering offset */
  23. #define staggerOffset    20                /* subsequent staggering offset */
  24. #define zoomSlop            3                /* pixels to leave on edges on zoom */
  25. #define dragSlop            4                /* window drag slop in pixels */
  26. #define intervalBB        10                /* tick interval between beachball spins */
  27. #define numPosSave        10                /* number of window positions to save
  28.                                                     for the query, edit, and help windows */
  29.  
  30. /*_____________________________________________________________________
  31.  
  32.     Types.
  33. _____________________________________________________________________*/
  34.  
  35. /* Window State. */
  36.  
  37. typedef struct WindState {
  38.     Rect        userState;            /* user state rectangle */
  39.     Boolean    zoomed;                /* true if in zoomed (standard) state */
  40.     Boolean    moved;                /* true if moved or grown */
  41. } WindState;
  42.  
  43. /* FieldInfo.
  44.  
  45.     The three fields name, attributes, and description are stored in
  46.     both Pascal and C formats.  The first byte is the Pascal length byte,
  47.     and a C zero terminator byte also follows the string.
  48.     
  49. */
  50.  
  51. typedef struct FieldInfo {
  52.     char            name[maxFieldName+2];    /* field name */
  53.     Boolean        hasChangeAttr;                /* true if field has change attribute */
  54.     Boolean        canEdit;                        /* true if field can be edited */
  55.     Boolean        dirty;                        /* true if field has been changed */
  56.     Boolean        putOK;                        /* true if field put ok */
  57.     Handle        servErrMsg;                    /* handle to server error message */
  58.     short            maxSize;                        /* max size */
  59.     char            **attributes;                /* handle to attributes */
  60.     char            **description;                /* handle to description */
  61.     char            **original;                    /* handle to original text */
  62.     short            origSize;                    /* size of original text */
  63.     short            nLines;                        /* number of lines in field */
  64.     TEHandle        edit;                            /* handle to TextEdit record */
  65. } FieldInfo;
  66.                                                                 
  67. typedef enum WindKind {
  68.     editWind = firstUserWindKind,        /* edit window */
  69.    queryWind,                                /* query window */
  70.     helpWind,                                /* help window */
  71.     firstModal,                                /* place holder - all subsequent
  72.                                                     window kinds are for movable modal
  73.                                                     window */
  74.     openModal,                                /* open ph record */
  75.     loginModal,                                /* login */
  76.     pswdModal,                                /* change password */
  77.     newModal,                                /* new ph record */
  78.     tranModal,                                /* server transaction */
  79.     siteModal,                                /* default site */
  80. } WindKind;
  81.  
  82. /*______________________________________________________________________
  83.  
  84.     Variables.
  85. _____________________________________________________________________*/
  86.  
  87. extern short            NumMenus;            /* number of menus in menu bar */
  88. extern MenuHandle        AppleMenu;            /* handle to apple menu */
  89. extern MenuHandle        FileMenu;            /* handle to file menu */
  90. extern MenuHandle        EditMenu;            /* handle to edit menu */
  91. extern MenuHandle        ProxyMenu;            /* handle to proxy menu */
  92. extern MenuHandle        WindowsMenu;        /* handle to windows menu */
  93. extern MenuHandle        HelpMenu;            /* handle to help menu */
  94. extern CursHandle        IBeamHandle;        /* handle to ibeam cursor */
  95. extern CursHandle        WatchHandle;        /* handle to watch cursor */
  96. extern CursHandle        BBArray[numBB];    /* array of handles to beachball cursors */
  97. extern RgnHandle        BigClipRgn;            /* infinite clip region */
  98. extern Boolean            Done;                    /* true when time to quit */
  99. extern short            PhPort;                /* Ph server port number */
  100. extern short            FontNum;                /* monaco font number */
  101. extern short            Ascent;                /* font ascent */
  102. extern short            Descent;                /* font descent */
  103. extern short            Leading;                /* font leading */
  104. extern short            LineHeight;            /* font line height */
  105. extern MenuHandle        SiteMenu;            /* handle to site popup menu */
  106. extern short            NumSites;            /* number of sites in menu */
  107. extern Handle            Servers;                /* handle to list of server 
  108.                                                         domain names */
  109. extern Handle            Domains;                /* handle to list of email
  110.                                                         domain names */
  111. extern Boolean            HaveBalloons;        /* true if balloon help available */
  112. extern Handle            HelpTopics;            /* handle to help topic list, or nil if
  113.                                                         help not available */
  114. extern Boolean            HelpNative;            /* true if only native help text avail */
  115. extern Str255            HelpServer;            /* current help server */
  116. extern short            HelpMenuLength;    /* length of initial part of help menu */
  117. extern unsigned long    LastSiteUpdate;    /* time of last site list update */
  118. extern unsigned long    LastHelpUpdate;    /* time of last help menu update */
  119. extern WindState        TranState;            /* saved transaction window state */
  120. extern WindState        LoginState;            /* saved login window state */
  121. extern WindState        NewState;            /* saved new window state */
  122. extern WindState        OpenState;            /* saved open window state */
  123. extern WindState        PswdState;            /* saved pswd window state */
  124. extern WindState        SiteState;            /* saved site window state */
  125. extern WindState        QueryStates[numPosSave];    /* saved query window states */
  126. extern WindState        EditStates[numPosSave];        /* saved edit window states */
  127. extern WindState        HelpStates[numPosSave];        /* saved help window states */
  128. extern Str255            DefaultServer;        /* default server domain name */
  129. extern Str255            DbOffMsg;            /* database turned off error message */
  130.  
  131. /*______________________________________________________________________
  132.  
  133.     Functions.
  134. _____________________________________________________________________*/
  135.  
  136. extern void glob_Error (short rezID, short index, Str255 p0);
  137. extern void glob_ErrorCode (OSErr rCode);
  138. extern void glob_ServErrorCode (short sCode);
  139. extern void glob_CheckPswdSel (DialogPtr theDialog);
  140. extern Boolean glob_FilterPswdChar (DialogPtr theDialog, char key, 
  141.     short modifiers, Str255 pswd);
  142. extern void glob_FilterPswdEditCmd (DialogPtr theDialog, short theItem, 
  143.     Str255 pswd);
  144. extern Boolean glob_FilterAsciiChar (DialogPtr theDialog, 
  145.     char key, short modifiers);
  146. extern Boolean glob_FilterPaste (void);
  147. extern void glob_DrawSitePopup (Rect *rect, short curSel);
  148. extern short glob_GetSiteIndex (Str255 server);
  149. extern void glob_PopupSiteMenu (Rect *rect, short oldSel, short *newSel,
  150.     Str255 newDomain);
  151. extern void glob_BringToFront (void);
  152.  
  153. #endif